package com.NetSunWeiQin.chapter11.flight;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class SimpleServer {
    public static void main(String args[]) {
        try {
            FlightFactory factory = new FlightFactoryImpl();

            Registry registry = LocateRegistry.createRegistry(1099);
            registry.rebind("FlightFactory", factory);

            System.out.println("服务器注册了一个FlightFactory对象");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}


